﻿using System;
using System.Collections.Generic;
using System.Text;
using uhul.data;
using System.Data.SqlTypes;

namespace testApp
{
  public class RoundTest
  {



    public static void testMe()
    {
      SqlBytes gdo;
      string wkt;


      gdo = sqlGeometryUtils.Wkt2GdoBlob("POINT(-32454320.345 -32453420.545)");

      gdo = sqlGeometryUtils.RoundGdoGeomCoords(gdo, 1);

      wkt = sqlGeometryUtils.GdoBlob2Wkt(gdo);




      string hexStrWkb = "0106000000060000000103000000010000001D00000008AC1C5AD6C524C1CDCCCC0CA0372DC1EE7C3FF5F4C524C139B4C83625372DC1F853E325DDC524C16F1283401A372DC1DD240641D7C524C1D122DBF912372DC11B2FDDE4D5C524C19318045605372DC1CDCCCCCCD6C524C1986E1283F9362DC1E7FBA9B1DCC524C17B14AEC7EC362DC133333333EBC524C19CC420B0E8362DC1BA490C4203C624C13D0AD7A3EF362DC14260E5D015C624C196438BECBE362DC146B6F3FDC5C524C1BA490CC298362DC1666666A6AEC524C19EEFA706A8362DC13D0AD7E3ADC524C108AC1C5AA8362DC1448B6CA793C524C114AE47A1B3362DC179E9267185C524C1AE47E1BAB6362DC18B6CE7FB86C524C1AC1C5AA4B8362DC15839B40881C524C18B6CE7FBC1362DC10AD7A33083C524C1C520B072CB362DC1713D0A5782C524C191ED7C3FCD362DC1F4FDD4B897C524C14E621058DB362DC19A999999AFC524C193180456F0362DC14C378981B2C524C1FCA9F19203372DC1F853E3A5B7C524C18716D9CE23372DC1F853E3A5B7C524C14C3789412A372DC12DB29DEFAFC524C17B14AEC74B372DC1D9CEF713ACC524C1F2D24D6257372DC19CC420F09DC524C14E6210986E372DC1A01A2FDD8EC524C1CBA145B67D372DC108AC1C5AD6C524C1CDCCCC0CA0372DC10103000000010000000A000000EE7C3FF5F4C524C139B4C83625372DC1295C8F8200C624C108AC1CDAF6362DC1BA490C4203C624C13D0AD7A3EF362DC133333333EBC524C19CC420B0E8362DC1E7FBA9B1DCC524C17B14AEC7EC362DC1CDCCCCCCD6C524C1986E1283F9362DC11B2FDDE4D5C524C19318045605372DC1DD240641D7C524C1D122DBF912372DC1F853E325DDC524C16F1283401A372DC1EE7C3FF5F4C524C139B4C83625372DC1010300000001000000050000008B6CE7FB1CC624C1CDCCCC0C063A2DC18FC2F5E851C624C16DE7FBA9A9392DC121B0726809C624C1B29DEF67A4392DC1931804560FC624C13F355EFAC1392DC18B6CE7FB1CC624C1CDCCCC0C063A2DC10103000000010000000A0000008B6CE7FB1CC624C1CDCCCC0C063A2DC1931804560FC624C13F355EFAC1392DC1E7FBA9318FC524C175931844B7392DC1E7FBA9318FC524C137894120EA392DC16F1283007EC524C123DBF9FE033A2DC12731086C99C524C17D3F35DE063A2DC16ABC74D3D2C524C1D9CEF7130D3A2DC1000000C01CC624C1F0A7C60B093A2DC1C520B0F21CC624C1A01A2F1D063A2DC18B6CE7FB1CC624C1CDCCCC0C063A2DC101030000000100000004000000E7FBA9B154C624C1022B87560B3A2DC17368912D40C624C19EEFA746D8392DC14A0C02EB22C624C148E17A140A3A2DC1E7FBA9B154C624C1022B87560B3A2DC1010300000001000000110000000000004084C524C110583974E13A2DC13F355EFA78C524C1D9CEF793AE3A2DC1DF4F8D5779C524C1B4C876FE883A2DC1E5D0221B74C524C1DD2406817F3A2DC18716D9CE66C524C1EC51B89E693A2DC1759318445FC524C139B4C836613A2DC1D7A3707D60C524C1F2D24D625A3A2DC1A01A2F9D68C524C1759318C4553A2DC123DBF9BE50C524C133333333493A2DC15A643BDF3AC524C1B6F3FD546D3A2DC18195438B3AC524C1FCA9F112833A2DC1F6285C4F3AC524C1DF4F8D97923A2DC12B8716D951C524C1DBF97EAA063B2DC1AC1C5A245AC524C1E7FBA9F1F73A2DC1B072689164C524C17B14AE07ED3A2DC13D0AD7237CC524C1FED478A9E13A2DC10000004084C524C110583974E13A2DC1";

      byte[] bWkb = GeometryStorageTest.HexStrToByteArray(hexStrWkb);
      gdo = sqlGeometryUtils.Wkb2GdoBlob(new SqlBytes(bWkb));

      gdo = sqlGeometryUtils.TrimGdoGeomCoords(gdo, 1);

      wkt = sqlGeometryUtils.GdoBlob2Wkt(gdo);

    }

  
  
  }

}
